import request from "../utils/request";


// TODO:从后台获取学生数据
export const getBookList = (currentPage:number, pageSize:number) => 
    request<any, any>({
        url: '/student/list',
        method: 'get',
        params: {
            currentPage,
            pageSize
        }
    })
export const searchBook = (keyword:string, currentPage:number, pageSize:number) =>
    request<any, any>({
        url: '/student/search',
        method: 'get',
        params: {
            keyword,
            currentPage,
            pageSize
        }
    })

export const updateBook = (student:DBBook) =>
    request<any, any>({
        url: '/student/update',
        method: 'post',
        data: student
    })

export const addBook = (stu:DBBook)=>
    request<any,any>({
        url: '/student/add',
        method: 'post',
        data: stu
    })

export const deleteBook = (id:number)=>request({
    url: '/student/delete',
    method: 'post',
    data: {id}
})
